<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //创建表
        Schema::create('articles', function (Blueprint $table) {
            $table->engine('innoDB');
            $table->increments('id');

            $table->string('table','191')->comment('标题');
            $table->string('cagetory','20')->comment('分类');
            $table->string('originate','191')->comment('来源');
            $table->smallInteger('page_views')->comment('浏览次数');
            $table->smallInteger('status')->comment('发布状态');

            $table->timestamps();
            $table->softDeletes()->comment('软删除');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
